import http from './http';

export const loginApi = (params: { username: string, password: string }): Promise<IResponse<any>> => http.post('/1024/login', params)

export const homeDataApi = (): Promise<IResponse<IHomeData>> => http.get('/6666')

export const questionTypesApi = (actionCode: string): Promise<IResponse<IQuetionType[]>> => http.get(`/1314/${actionCode}/all`)

export const getQuetionListApi = (params: {
  testNum: number; testType: string; actionCode: string; questionType: string
}): Promise<IResponse<IQustion[]>> => http.post('/1314', params)

export const validateAnswerApi = (params: {
  categoryCode: string, actionType: string, userAnswer: string, actionCode: string, id: number
}) => http.put('/1314', params)

export const getSubjectsApi = (): Promise<IResponse<ISubject[]>> => http.get('/6666/field');